//
//  ListenCell.m
//  JianChaRiBao
//
//  Created by yuzhou on 13-5-22.
//  Copyright (c) 2013年 wzyk. All rights reserved.
//

#import "ListenCell.h"
#import "UIImageView+WebCache.h"
#import <QuartzCore/QuartzCore.h>

@interface ListenCell ()
{
    UIImageView *coverImageView;
}
@end

@implementation ListenCell

- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        coverImageView = [[[UIImageView alloc] initWithFrame:self.bounds] autorelease];
        coverImageView.layer.shadowColor = [UIColor blackColor].CGColor;
        coverImageView.layer.shadowOpacity = 0.45;
        coverImageView.layer.shadowOffset = CGSizeMake(0, 6);
        coverImageView.layer.shadowPath = [UIBezierPath bezierPathWithRect:coverImageView.bounds].CGPath;
        coverImageView.layer.masksToBounds = NO;
        [self.contentView addSubview:coverImageView];
        self.selectionStyle = AQGridViewCellSelectionStyleNone;
    }
    return self;
}

- (void)updateDisplay
{
    NSString *coverURLStr = [[_listenInfo objectForKey:@"image"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [coverImageView setImageWithURL:[NSURL URLWithString:coverURLStr] placeholderImage:[UIImage imageNamed:@"listen_default_image"]];
}

- (void)dealloc
{
    [_listenInfo release];
    [super dealloc];
}

@end
